package model

import (
	"sync"
	"time"
)

type BaseModel struct {
	Id       uint64     `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"-"`
	CreateAt time.Time  `gorm:"column:created_at" json:"-"`
	UpdateAt time.Time  `gorm:"column:updated_at" json:"-"`
	DeleteAt *time.Time `gorm:"column:deleted_at" sql:"index" json:"-"`
}

//用户信息
type UserInfo struct {
	Id       uint64 `json:"id"`
	Username string `json:"username"`
	SayHello string `json:"say_hello"`
	Password string `json:"password"`
	CreateAt string `json:"create_at"`
	UpdateAt string `json:"update_at"`
}

//用户列表
type UserList struct {
	Lock  *sync.Mutex
	IdMap map[uint64]*UserInfo
}

//Token represents a JSON web token
type Token struct {
	Token string `json:"token"`
}
